package com.xinqing.test.LetCode;

import org.apache.commons.lang.ArrayUtils;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @Author:CHQ
 * @Date:2021/7/20 14:07
 * @Description
 */
public class Merge {
    public static void main(String[] args) {

        int[] nums1 = {1, 2, 3};
        int[] nums2 = {2, 5, 6};
        ArrayList<Integer> list = new ArrayList<>();

        for (int i = 0; i < nums1.length; i++) {
            list.add(nums1[i]);
        }

        for (int j = 0; j < nums2.length; j++) {
            list.add(nums2[j]);
        }
        int[] res = ArrayUtils.addAll(nums1, nums2);
        Arrays.sort(res);
        for (int x = 0; x < res.length; x++) {
            System.out.print(res[x] + " ");
        }

    }
}
